<!doctype html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport"
          content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
</head>
<body>
    <h1>调用应用侧函数</h1>
    <button>吃饭</button>
    <button>睡觉</button>
    <button>玩游戏</button>

    <script>
        document.querySelector('button').onclick = () => {
            console.log('点击了页面的按钮')
            // 调用应用侧的函数
            AppFns.eat()
        }
        document.querySelectorAll('button')[1].onclick = () => {
            // 调用应用侧的函数
            AppFns.sleep()
        }
        document.querySelectorAll('button')[2].onclick = () => {
            // 调用应用侧的函数
            AppFns.play('连连看')
        }
    </script>
</body>
</html>